﻿using System.Collections.Generic;

namespace MvcWebScraper.Core.Parsers
{
	public class AuCIDRParser : MobileCIDRScraper<List<string>>
	{
		protected override List<string> Parser(HtmlAgilityPack.HtmlDocument document)
		{
			var cidr = new List<string>();
			foreach (var tr in document.DocumentNode.SelectNodes("/html/body/div[1]/table/tr/td/table[3]/tr[1]/td[5]/table[2]/tr[5]/td[2]/table[3]/tr[2]/td[1]/table/tr[position()>1]"))
			{
				var ipNode = tr.SelectSingleNode("td[2]/div");
				var maskNode = tr.SelectSingleNode("td[3]/div");
				cidr.Add(ipNode.InnerText + maskNode.InnerText);
			}
			return cidr;
		}
	}
}
